﻿package {
	import flash.display.Sprite;
	import flash.text.*;
	import flash.events.*;
	
	public class ArrayCalculation extends Sprite {
	
	
		private var Array01:Array = new Array(3,4,8,9,5,7,2);
		private var Array02:Array = new Array(1,2,11,3,6,7,5);
		private var temp:Number=0;	
		private var ResultFormat:TextFormat = new TextFormat("Arial",15,0xFFFFFF,true,null,null,null,null,"left");
		

		public function ArrayCalculation() {
			
			
			
			for (var i = 0; i < Array01.length; i++) {
				for (var j = 0; j < Array02.length; j++) {
					if (Array01 [i] == Array02 [j]) {
						temp++;
						
						var Results:TextField = new TextField();
						addChild(Results);
						Results.x=200;
						Results.y=100+temp*20;
						Results.text="交集數值 :"+String(Array02 [j]);
						Results.defaultTextFormat = ResultFormat;
						
						trace("交集數值	:"+Array02 [j]);
						
					}
				}
			}	
			
			
								
		}
		
	}
}